package com.linwen.javase.desgin_pattern.create.factory.simple_factory;

import com.linwen.javase.desgin_pattern.create.factory.BYD;
import com.linwen.javase.desgin_pattern.create.factory.Car;
import com.linwen.javase.desgin_pattern.create.factory.MBW;

/**
 * @ClassName SimpleCarFactory
 * @Description
 * @Author lin
 * @Date 2022/6/12 下午11:49
 * @Version V1.0
 */
public class SimpleCarFactory {
    public static Car getCar(String name) {
        switch (name) {
            case "宝马":
                return new MBW();
            case "比亚迪":
                return new BYD();
            default:
                return null;
        }
    }
}
